<template>
    <div class="my">
        <div class="my-header">
            <div class="my-header-left">
                <text class="title">您在 Postgraduate 服务中的个人资料信息</text>
                <text class="content">个人信息以及用于管理这些信息的选项。您可以向他人公开部分信息（例如您的详细联系信息），以方便他们与您联系。您还可以查看您的个人资料的摘要。</text>
            </div>
            <div class="my-header-right">
                <img src="/public/centerIcons/identify.png" />
            </div>

        </div>

        <div class="my-content">
            <el-card>
                <div class="card-header">
                    <span class="card-title">基本信息</span>
                    <div class="message">
                        <span>使用 Google 服务的其他用户可能会看到部分信息。 </span>
                        <span class="link">了解更多</span>
                    </div>
                </div>
                <div class="card-content">
                    <div class="avatar">
                        <div class="content-message">
                            <span>个人头像</span>
                            <text>头像有助于个性化账户</text>
                        </div>
                        <div><img :src="`${BaseUrl}${$store.state.userInfo.avatar}`" class="avatarImg" /> </div>
                    </div>
                    <div class="content-item">
                        <div class="content-message">
                            <span>用户昵称</span>
                            <text class="info">{{ $store.state.userInfo.nickname }}</text>
                        </div>
                        <div>
                            <img src="/public/centerIcons/right.png" />
                        </div>
                    </div>
                    <div class="content-item">
                        <div class="content-message">
                            <span>用户年龄</span>
                            <text class="info">{{ $store.state.userInfo.age }}</text>
                        </div>
                        <div>
                            <img src="/public/centerIcons/right.png" />
                        </div>
                    </div>
                    <div class="content-item">
                        <div class="content-message">
                            <span>用户名</span>
                            <text class="info">{{ $store.state.userInfo.username }}</text>
                        </div>
                        <div>
                            <img src="/public/centerIcons/right.png" />
                        </div>
                    </div>


                </div>
                <template #footer>Footer content</template>
            </el-card>
        </div>
    </div>
</template>

<script setup>
import { BaseUrl } from '../../../server/userApi';
</script>

<style lang="scss" scoped>
.my {
    width: 100%;
    height: 700px;
    /*overflow-y: scroll;*/

    .my-header {
        display: flex;
        margin-top: 20px;
        margin-left: 20px;


        .my-header-left {
            width: 460px;

            display: flex;
            flex-direction: column;
            /* 两端对齐*/
            text-align: justify;


            .title {
                font-size: 24px;
                margin-bottom: 10px;
            }

            .content {
                color: rgb(101, 99, 97);
                /* 行间距*/
                line-height: 26px;

            }
        }

        .my-header-right {

            margin-left: 20px;

            img {
                width: 300px;
                margin-left: 80px;

            }
        }
    }

    .my-content {
        width: 100%;
        margin: 20px 0;

        .el-card {
            width: 80%;
            box-shadow: none;
            border-radius: 10px;

            :deep(.el-card__body) {
                padding: 0;
            }

            .card-header {
                margin: 30px 0 10px 30px;

                .card-title {
                    font-size: 24px;

                }

                .message {
                    font-size: 16px;

                    margin-top: 10px;
                    color: grey;

                    .link {
                        color: skyblue;
                        cursor: pointer;
                    }
                }
            }

            .card-content {

                font-size: 14px;

                .avatar,
                .content-item {
                    width: 100%;
                    display: flex;
                    align-items: center;
                    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
                    justify-content: space-between;
                    cursor: pointer;

                    .content-message {
                        width: 60%;
                        display: flex;
                        align-items: center;
                        color: #999999;


                        span {
                            width: 181px;
                            margin-left: 30px;
                        }

                        text {
                            margin-left: 10px;

                        }

                    }


                    &:hover {
                        background-color: rgba(0, 0, 0, 0.1);
                    }

                }

                .avatar {
                    height: 90px;

                    img {
                        width: 60px;
                        height: 60px;
                        border-radius: 50%;
                        margin-right: 30px;

                    }

                }

                .content-item {
                    height: 60px;

                    .info {
                        font-size: 18px;
                        color: black;
                    }
                    img {
                        width: 30px;
                        height: 30px;
                        padding-right: 45px;
                    }
                }
            }
        }
    }
}

</style>